var coap  = require('coap') ;
var bl = require("bl");
var req   = coap.request({               
                host:"127.0.0.1",
                pathname:"",               
                method: 'POST'
              });
req.setOption("Block2",[new Buffer("155555555555555"),new Buffer("2"),new Buffer("15302142252")]);
req.on('response', function(res) {
	console.log("resresresres");
	console.log(res);
	//console.log(res.options);
    //将响应结果输出
	res.pipe(bl(function(err, data) { 
	console.log(err);
	console.log(data.toString());
		//console.log(data);	
       /* var json = JSON.parse(data);  
        console.log(json);  */
        process.exit(0);  
    })) 
})

req.end()